#ifndef PROJECTTASKMODEL_H
#define PROJECTTASKMODEL_H

#include <KDGanttView>
#include <KDGanttConstraintModel>
#include <KDGanttDateTimeGrid>
#include <KDGanttGlobal>
#include <KDGanttGraphicsView>
#include <KDGanttItemDelegate>
#include <KDGanttStyleOptionGanttItem>

#include <QAbstractTableModel>
#include <QDate>
#include <QModelIndex>

struct ProjectTask
{
    QString projectName;
    QString stroyName;
    QString taskId;
    QString taskName;
    QString taskStatus;
    QString developName;
    QString developRole;
    QString consumed;
    QString title;
    QDate start;
    QDate end;
};

namespace KDGantt {
class View;
}

class ProjectTaskModel : public QAbstractTableModel
{
public:
    explicit ProjectTaskModel(QObject *parent = nullptr);

public:
    QList<ProjectTask> m_tasks;
    QList<QString> m_horHeaderData;
    QDate m_startDate;
    QDate m_endDate;
    int m_modelFlag =0;

    void moveRow(int from, int to);
    bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role) ;
    QVariant headerData(int section, Qt::Orientation orientation, int role);
    bool setHorHeaderData(const QList<QString> &headers);
    void setModelData(const QList<ProjectTask> &datas);
    QVariant data(const QModelIndex &index, int role);
    int columnCount(const QModelIndex &index);
    int rowCount(const QModelIndex &index);


};

#endif // PROJECTTASKMODEL_H
